﻿namespace ApiLib.RCL.Models;

/// <summary>
/// 文件信息
/// </summary>
public class FileInfo
{
    public string Path { get; set; }
    public string Name { get; set; }
    public string Ext { get; set; }
    public long Length { get; set; }
    
    public FileInfo (){}

    public FileInfo(string path)
    {
        Path = path;
        Name = System.IO.Path.GetFileName(path);
        Ext = System.IO.Path.GetExtension(path);
    }

    /// <summary>
    /// 是图片
    /// </summary>
    /// <returns></returns>
    public bool IsImage()
    {
        return Ext is ".png" or ".jpg" or ".jpeg" or ".svg";
    }
}